<?php
defined('_JEXEC') or die('Restricted access');

$weblinkparams = $weblinkitems['params'];
unset($weblinkitems['params']);

if(!empty($weblinkparams['title'])):?><h3 class="weblinkinfo_title<?php echo $weblinkparams['suffix']; ?>"><?php echo $weblinkparams['title']; ?></h3><?php endif;?>
<ul class="weblinkinfo<?php echo $weblinkparams['suffix']; ?>">
<?php
foreach($weblinkitems as $links):
	if(!empty($links['title']) && $weblinkparams['showcattitle']):?>
	<li class="weblinkinfocat<?php echo $weblinkparams['suffix']; ?>">
		<?php	if(!empty($links['image']) && $weblinkparams['showthumb']):
		echo JHTML::image(JRoute::_("images/stories/". $links['image']), $links['title'],'width='. $weblinkparams['catImageWidth']);
		endif;?>
		<strong><?php echo $links['title']; ?></strong>
		<?php if(!empty($links['description']) && $weblinkparams['showCatDescription']):
			echo '<br />'. $links['description'];
		endif;
	endif;?>
		<ul>
	<?php foreach($links['list'] as $link):
			$hits = '';
			if($weblinkparams['hit']):
			$hits = '<small>&nbsp;('. $link->hits. ')</small>';
			endif;?>
			<li>
			<a href="<?php echo $link->link; ?>" title="<?php echo $link->title; ?>" target="<?php echo $weblinkparams['target']; ?>">
			<?php echo $link->thumbnail. $link->title. $hits; ?>
			</a>
			<?php if($weblinkparams['showdesc'] && !empty($link->description)):?>
			<br /><small><?php echo $link->description;?></small>
			<?php endif;?>
			</li>
	<?php endforeach;?>
		</ul>
	</li>
<?php endforeach;?>
<br />
	<a href="index.php?option=com_weblinks&catid=32&Itemid=64">Ver Todas</a>
</ul>

<?php
unset($weblinkparams);
unset($weblinkitems);